<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="css/base.css">
<link rel="stylesheet" href="css/register.css">
<link type="text/css" rel="stylesheet" href="css/style.css" />
<script src="js/jquery-1.12.4.js"></script>
<script type="text/javascript">
	$(function(){
		$("hd_zc").click(function(){
			var phone=$("#phone").val();
			var password=$("#password").val();
			var shenfen=$("#shenfei").val();
			var yanzheng=$("#yanzheng").val();
			var shengfen=$("#shengfen").val();
			var chengshi=$("#chengshi").val();
			var dizhi=$("#dizhi").val();
			var dz=shengfen+chengshi+dizhi;
			var yongHu=[{"yh_ZhangHao":phone},{"yh_MiMa":password},
			            {"yh_sfz":shenfen},{"yanzheng":yanzheng},{"dizhi":dz}];
			$.getPOST("yonghuservlet",yongHu,function(){
	
			});
		});
		
	});
</script>
</head>
<body>
	<!--网页头部-->
	<div id="a1"></div>
	<header>
		<div class="soubg">
			<div class="sou fl">
				<div class="s_city_b">
					<span></span>
				</div>
			</div>
			<div class="fr top_right">
				<div class="fl">
					<c:set var="kehu" value="${sessionScope.denglu }"></c:set>
					<c:if test="${empty kehu }">
						<div id="">
							<a id="dl" style="color:#FCFCFC;">登录</a> 
							<a id="a2" style="color:#FCFCFC;">注册</a>
						</div>
					</c:if >
					<c:if test="${!empty kehu }">
						<div id="">
							<a id="" href="yonghuservlet?typ=denglu_houtai" style="color:#FCFCFC;">${kehu.account }</a>
							<a id="yh_zhuxiao" href="yonghuservlet?typ=zhuxiao" style="color:#FCFCFC;">注销</a>
						</div>
					</c:if>
				</div>
				<ul class="ss">
					<li class="ss_list"><a href="#" style="color:#FCFCFC;">收藏夹</a>
					</li>
					<!--需要有向下的小箭头就添加ss_listBg-->
					<li class="ss_list ss_listBg"><a href="#"
						style="color:#FCFCFC;">客户服务</a>
						<div class="ss_list_bg">
							<div class="ss_list_c">
								<ul>
									<li><a href="#">包裹跟踪</a></li>
									<li><a href="#">常见问题</a></li>
									<li><a href="#">在线退款</a></li>
									<li><a href="#">在线投诉</a></li>
									<li><a href="#">配送范围</a></li>
								</ul>
							</div>
						</div></li>
					<li class="ss_list"><a href="#" style="color:#FCFCFC;">网站导航</a>
					</li>
				</ul>
				<span class="fl">&nbsp;&nbsp;关注我们：</span> <span class="s_sh">
					<a href="#" class="sh1">新浪</a> <a href="#" class="sh2">微信</a>
				</span>

			</div>
		</div>

		<div class="top">
			<div class="logo">
				<a href="#"> <img class="logoimg" src="images/tt4.png" />
				</a>
			</div>
			<div class="search">
				<form action="sousuoservlett" method="post">
					<input type="hidden" name="ss_sousuo" value="zhusou"   />
					<input type="search" value="" name="ss_neirong" id="aaaaaa" placeholder="请输入关键字" class="s_ipt" />
					<input type="submit" value="搜索" class="s_btn" />
				</form>
				<!-- 搜索框下边 -->
				<!-- <div class="fl">
		                <a href="#">咖啡</a>
		                <a href="#">iphone 6S</a>
		                <a href="#">新鲜美食</a>
		                <a href="#">蛋糕</a>
		                <a href="#">日用品</a>
		                <a href="#">连衣裙</a>
		            </div> -->
			</div>
			<div class="i_car">

				<div class="car_t">
					<img src="images/car.png">购物车
				</div>
				<div class="last">
					<div class="noshop">
						<img src="images/3.jpg" alt="" />
						<h3>购物车</h3>
					</div>
					<div class="shop">
						<ul id="shops">
							<li>
								<h4>
									良品铺子 <span class="J_count">共1件商品</span>
								</h4>
								<div class="clear">
									<div class="shopImg">
										<img src="images/dd1.jpg" />
									</div>
									<div class="
											 shopText">
										<div class="clear">
											<h5>五香豆干</h5>
											<a href="#" class="close J_btnDelete">X</a>
										</div>
										<p>豆制品</p>
										<div class="clear">
											<div class="plush">
												<span class="J_btnDelCount">-</span> <input
													class="J_inputCount" type="text" value="1" /> <span
													class="J_btnAddCount">+</span>
											</div>
											<strong class="J_smallTotalPrice">￥12</strong>
										</div>
									</div>
								</div>
								<p></p>
							</li>

						</ul>
						<div class="option">
							<a href="#">意见反馈</a>
						</div>
						<div class="buy">
							<p>
								合计 <span class="J_totalPrice">￥300.8</span>
							</p>
							<a href="gouwuche.jsp">立即结算 <span class="J_totalCount">(3)</span></a>
						</div>
					</div>
				</div>
			</div>
		</div>
		<script type="text/javascript">

		$(function(){
		
			 $.getJSON("carts",function(addlist){	
				 for(var i in addlist.list){
                     $("#shops").append("<li>"
								+"<h4>"
								+""+addlist.list[i].brand+""
							+"</h4>"
							+"<div class=\"clear\">"
							+"<div class=\"shopImg\">"
							+"<img src=\"upload/"+addlist.list[i].shopimg+"\" />"
									+"</div>"
									+"<div class=\"shopText\">"
									+"<div class=\"clear\">"
									+"<h5>"+addlist.list[i].shopname+"</h5>"
									+"<a href=\"#\" class=\"close J_btnDelete\">X</a>"
									+"</div>"
									+"<p>"+addlist.list[i].kind+"</p>"
									+"<div class=\"clear\">"
									+"<div class=\"plush\">"
									+"<span class=\"J_btnDelCount\">"+addlist.list[i].kucun+"</span>"
									+"</div>"
									+"<strong class=\"J_smallTotalPrice\">￥"+addlist.list[i].shoporice+"</strong>"
									+"</div>"
									+"</div>"
									+"</div>"
									+"<p></p>"
							+"</li>");
                     };
                  });
		})
		
		</script>
		
		
	</header>
	<!-- 隐藏的注册 -->
	<section id="secTab">
		<form  id="registerForm" action="yonghuservlet"  method="post">
		<input type="hidden" name="typ" value="zhuce">
			<div class="innerTab">
				<h2>注册</h2>
				<div class="tableItem">
					<span>账&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号：</span> 
					<input id="phone" type="text" required name="phone" placeholder="请输入账号" />
					<span class="tishi" id="zh">*</span>
					<script type="text/javascript">
						$(function(){
							$("#phone").blur(function(){
								var phone=$(this).val();
								$.getJSON("yonghuservlet?typ=yanzheng&pay="+phone,function(zhanghao){
									$("#zh").html("");
									$("#zh").html(zhanghao);
								});
							});
						});
					</script>
				</div>
				<div class="tableItem">
					<span>密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码：</span>
					 <input id="password" type="password" required name="password"
						placeholder="请输入6-18位密码" /> <span class="tishi" id="mm">*</span>
				</div>
				<div class="tableItem">
					<span>输入密码：</span> 
					<input id="pwd" type="password" required name="password" placeholder="请再次输入6-18位密码" /> 
					<span class="tishi" id="mm1">*</span>
				</div>
				<div class="tableItem">
					<span>身份证号：</span> 
					<input id="shenfei" type="text" required name="shenfei" placeholder="请输入身份证号" /> 
					<span class="tishi" id="sf">*</span>
				</div>
				<div class="cf">
					<div class="tableItem onlyItem fl">
						<span>验&nbsp;证&nbsp;&nbsp;码：</span> 
						<input id="yanzheng" required class="yanzheng" type="text" name="yanzheng" />
						<span><img style="cursor:pointer;" id="tu" src="yanzhengma" onclick="imgrefresh()"></span>
						<script type="text/javascript">
                		function imgrefresh(){
                			document.getElementById("tu").src="yanzhengma?id="+Math.random()+"";
                		}
                		$("#yanzheng").blur(function(){
                			$.getJSON("yangzhengma",{"code":$(this).val()},function(res){
                		
                			});
                	});              	               	
                </script>
				</div>
				<span class="tishi" id="yz">*</span>
				</div>
				
				<script type="text/javascript">
					$.getJSON("chengshiservlet?sf=shengfen",function(list){
						for(var i in list){
							var ii=i;
							$("#shengfen").append("<option name='shengfen' value='"+(++ii)+"'>"+list[i].s_name+"</option>");
						}
					});
					$(function(){
						$("#shengfen").change(function(){
							$("#chengshi option").remove();
							var sf=$("#shengfen").val();
							$.getJSON("chengshiservlet?sf=chengshi&shengf="+sf,function(lis){
								var ii=i;
								for(var i in lis){								
									$("#chengshi").append("<option name='chengshi' value='"+(++ii)+"'>"+lis[i].cs_name+"</option>");
								}
							});
						});
					});
				</script>
				<div class="tableItem">
					<span>地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;址：</span>
					 <select id="shengfen" >
						<option name="shengfen" value="0">省份</option>
					</select> 
					<select id="chengshi" >
						<option name="chengshi" value="0">城市</option>
					</select>
				</div>
				<div class="tableItem">
					<span>街道地址：</span> <input id="dizhi" name="dizhi" required type="text"
						name="dizhi" placeholder="街道信息" /> <span class="tishi" id="dz">*</span>
				</div>
				<div id="zuc">
					<p class="clickRegist">
						点击注册，表示您同意1号店 <a href="#">《服务协议》</a>
					</p>
					<input id="hd_zc"  type="submit" class="tableBtn" value="同意并注册">
					<div id="" class="qx">取消</div>
				
				</div>

			</div>
		</form>
	</section>
	<!-- 登录框 -->
	<div class="denglu ">
		<h2 class="h2">1号店用户登录</h2>
		<form id="form" method="post" action="yonghuservlet">
		<input type="hidden" name="typ" value="denglu">
			<div class="tableTap cf">

				<a class="fr" href="#">注册账号</a>
			</div>
			<div class="tableItem">
				<span>账&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号：</span>
				<!--邮箱、以13、15、18开头的电话或者是2~4个汉字-->
				<input type="text" name="userName" placeholder="用户名" required />
			</div>
			<div class="tableItem">
				<span>密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码：</span> <input
					type="password" name="password" placeholder="密码" required
					pattern="^\w{6,10}$" />
			</div>
			<div class="tableAuto cf">
				<a class="autoMatic fl" href="#"><input class="loadGiet"
					type="checkbox" />自动登录</a> <a class="fr" href="#">忘记密码？</a>
			</div>
			<!--<button class="tableBtn">登录</button>-->
			<div id="kkk">
				<input type="submit" class="tableBtn" value="登录" /> <input
					type="button" class="qx" name="" id="qx" value="取消" />
			</div>
		</form>

		<div class="outType cf">
			<ul class="loadType cf">
				<li class="wx">&nbsp;</li>
				<li class="zfb">&nbsp;</li>
				<li class="xl">&nbsp;</li>
				<p class="loadMore fr">
					更多合作网站<i></i>
				</p>
			</ul>
		</div>
	</div>
	<script src="js/register.js"></script>
</body>
</html>
